package com.hb.formation.planning.entites;

import java.util.ArrayList;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

//
//
//  Generated by StarUML(tm) Java Add-In
//
//  @ Project : Untitled
//  @ File Name : Utilisateur.java
//  @ Date : 14/04/2014
//  @ Author : Yannick
//
//



@Entity
@Table
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name="type", discriminatorType = DiscriminatorType.STRING)
public abstract class Utilisateur
{
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "ID")
	private int id;
	@Column
    private String nom;
	@Column
    private String prenom;
	@Column
    private String identifiant;
	@Column
    private String mailContact;
	@Column
    private String password;
	@ManyToOne
	@JoinColumn(name="equipe")
	private Equipe equipe;
	@ManyToOne(cascade = CascadeType.ALL)
	private Adresse adresse;
	@Transient
    private ArrayList<String> permis;

	// constructeur
	public Utilisateur(String nom, String prenom, String identifiant,
			String mailContact, String password, ArrayList<String> permis, Adresse adresse, Equipe equipe) {
		this.setAdresse(adresse);
		this.setEquipe(equipe);
		this.setIdentifiant(identifiant);
		this.setMailContact(mailContact);
		this.setNom(nom);
		this.setPrenom(prenom);
		this.setPassword(password);
		this.setPermis(permis);
	}

	public Utilisateur() {

	}
    
    public void seConnecter()
    {
    
    }
    
    //getters et setters
	public String getNom() {
		return nom;
	}
	
	public void setNom(String nom) {
		this.nom = nom;
	}
	
	public String getPrenom() {
		return prenom;
	}
	
	public void setPrenom(String prenom) {
		this.prenom = prenom;
	}
	
	public String getIdentifiant() {
		return identifiant;
	}
	
	public void setIdentifiant(String identifiant) {
		this.identifiant = identifiant;
	}
	
	public String getMailContact() {
		return mailContact;
	}
	
	public void setMailContact(String mailContact) {
		this.mailContact = mailContact;
	}
	
	public String getPassword() {
		return password;
	}
	
	public void setPassword(String password) {
		this.password = password;
	}
	
	public ArrayList<String> getPermis() {
		return permis;
	}
	
	public void setPermis(ArrayList<String> permis) {
		this.permis = permis;
	}

	public Equipe getEquipe() {
		return equipe;
	}

	public void setEquipe(Equipe equipe) {
		this.equipe = equipe;
	}

	public Adresse getAdresse() {
		return adresse;
	}

	public void setAdresse(Adresse adresse) {
		this.adresse = adresse;
	}
}
